// Enable username and password fields of Replica Systems
function enable_activation(clear_fields) {
	if ( $('enable_autentication').checked ) {
		$('replica_system_username').enable();
		$('replica_system_password').enable();
	} else {
		$('replica_system_username').disable();
		$('replica_system_password').disable();
		
		if ( clear_fields ) {
			$('replica_system_username').clear();
			$('replica_system_password').clear();
		}
	}
}

function change_arrow(element_to_replace, text_element) {
	if ( $(element_to_replace).childElements()[0].readAttribute('alt') == 'Toggle_right' )
		$(element_to_replace).replace("<span id='" + element_to_replace + "'><img src='/images/toggle_down.png' alt='Toggle_down' title='Hide " + text_element + "' /></span>");
	else
		$(element_to_replace).replace("<span id='" + element_to_replace + "'><img src='/images/toggle_right.png' alt='Toggle_right' title='Show " + text_element + "' /></span>");
		
	/*if ( !$(visible_element).visible() )
		$(element_to_replace).replace("<span id='" + element_to_replace + "'><img src='/images/toggle_down.png' alt='Toggle_down' /></span>");
	else
		$(element_to_replace).replace("<span id='" + element_to_replace + "'><img src='/images/toggle_right.png' alt='Toggle_right' /></span>");*/
}